Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: OpenDoc Class Reference /
Part 1 - Classes and Methods / ODDraft


CreateFrame

The CreateFrame method creates a new frame in this draft.

ODFrame CreateFrame (in ODObjectType frameType, 
                     in ODFrame containingFrame, 
                     in ODShape frameShape,
                     in ODCanvas biasCanvas,
                     in ODPart part,
                     in ODTypeToken viewType, 
                     in ODTypeToken presentation, 
                     in ODBoolean isSubframe,
                     in ODBoolean isOverlaid);
frameType
The type of the frame to be created. The frame type must be either a regular frame (kODFrameObject) or a nonpersistent frame (kODNonPersistentFrameObject).
containingFrame
A reference to the containing frame of the frame being created.
frameShape
A reference to the frame shape to be created.
biasCanvas
A reference to the canvas to whose coordinate space the new frame is biased, or kODNULL to use the standard platform coordinate bias.
part
A reference to the part to be displayed in the new frame.
viewType
A tokenized string representing the initial view type for the new frame.
presentation
The initial presentation for the new frame.
isSubframe
kODTrue if the new frame is a subframe, otherwise kODFalse.
isOverlaid
kODTrue if the new frame should be an overlaid frame, otherwise kODFalse.
return value
A reference to the newly created frame object.
DISCUSSION
This method constructs and returns a frame object in this draft; the new frame has the characteristics specified by parameters. You can create a regular frame (kODFrameObject) only if this draft's current permissions provide write access.

The viewType parameter must be the tokenized form of one of the view-type constants (kODViewAsFrame, kODViewAsLargeIcon, kODViewAsSmallIcon, or kODViewAsThumbnail). You can call the session object's Tokenize method to obtain a token corresponding to one of these constants.

This method initializes the reference count of the returned frame. When you have finished using that frame, you should call its Release method.

If this method executes successfully, it marks this draft as dirty.

EXCEPTIONS
kODErrCannotCreateFrame
Cannot create the frame object.
kODErrInvalidObjectType
The specified frame type is not kODFrameObject or kODNonPersistentFrameObject.
SEE ALSO
The ODObjectType type (page 903).
The ODTypeToken type (page 877).
The ODDraft::AcquireFrame method (page 153).
The ODSession::Tokenize method (page 622).
The ODFrame class (page 294).
"Creating a New Embedded Frame" on page 119 in OpenDoc Programmer's Guide.
"Adding an Embedded Part" on page 305 in OpenDoc Programmer's Guide.
"Embedding a Single Part" on page 347 in OpenDoc Programmer's Guide.
Table 11-1 on page 466 in OpenDoc Programmer's Guide.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
17 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help